FROM maven:3.8.3-jdk-11-slim AS builder

WORKDIR /build/

COPY . .
RUN mvn -Dmaven.test.skip=true clean compile package install

FROM openjdk:11.0.12-jre-slim-buster

LABEL maintainer="<yaolianhua@cloudtogo.cn>"

WORKDIR /gendb/

COPY mysql mysql
COPY --from=builder /build/gendb-starter/target/gendb.jar .
ENV JAVA_OPTS="-Xms128m -Xmx512m"
EXPOSE 8080

CMD java $JAVA_OPTS -jar gendb.jar